package cn.com.open.itembank.common.enums;

/**
 * Created by lucky on 2017/9/27.
 */

/**
 * 审核标记：0，未审核；1，已审核.
 */
public enum CheckType {
    /**
     * 未审核（默认）
     */
    UNCHECK(0),
    /**
     * 审核通过
     */
    CHECKED(1),
    /**
     * 审核拒绝
     */
    NOCHECKED(2);

    private Integer index;

    CheckType(Integer idx) {
        this.index = idx;
    }

    /**
     * Gets index.
     *
     * @return the index
     */
    public Integer getIndex() {
        return index;
    }

    /**
     * From value check type.
     *
     * @param v the v
     * @return the check type
     */
    public static CheckType fromValue(Integer v) {
        for (CheckType c : CheckType.values()) {
            if (c.getIndex() == v) {
                return c;
            }
        }
        return null;
    }
}
